Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

how to play file type ".unknown_video" [Solved]

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

how to play file type ".unknown_video" [Solved]

  • Quote

Post by dpaddy » Fri Feb 11, 2022 3:27 pm

youtube-dl successfully downloads (what I suppose is a video) with filetype .unknown_video but mplayer can't play it. How do I get youtube-dl to convert to a playable format, or how do I convert -- after the download -- to a playable format, or how do I get mplayer to play type .unknown_video, or what player other than mplayer will play type .unknown_video?
Last edited by dpaddy on Sun Feb 13, 2022 3:16 pm, edited 2 times in total.
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Fri Feb 11, 2022 4:12 pm

Try

Code: Select all

emerge -pv ffmpeg mplayer
:)
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Fri Feb 11, 2022 4:34 pm

What does 'file' tell you for your '.unknown_video' file?

Code: Select all

file <filename>
Top
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

  • Quote

Post by dpaddy » Fri Feb 11, 2022 5:15 pm

Yikes! I feel stupid. The file foo.unknown_video I downloaded via youtube-dl is only 892 bytes, so I suppose it is at best some sort of pointer to a video rather than the video itself, or at worst youtube-dl is simply not an appropriate tool to snag the video :oops:

Anyhow, since you asked:

Code: Select all

# emerge -pv ffmpeg mplayer 
 * Last emerge --sync was 160d 1h 3m 9s ago.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-video/ffmpeg-4.4-r1:0/56.58.58::gentoo  USE="X alsa amr amrenc bzip2 cdio cpudetection dav1d doc encode gmp gnutls gpl iconv jack libdrm mp3 network openh264 postproc rubberband theora threads vaapi vpx x264 x265 xvid zlib (-appkit) -bluray -bs2b -chromaprint -chromium -codec2 (-cuda) -debug -fdk -flite -fontconfig -frei0r -fribidi -gcrypt -gme -gsm -hardcoded-tables -iec61883 -ieee1394 -jpeg2k -kvazaar -ladspa -libaom -libaribb24 -libass -libcaca -libilbc -librtmp -libsoxr -libtesseract -libv4l -libxml2 -lv2 -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug -openal -opencl -opengl -openssl -opus -oss -pic -pulseaudio -rav1e -samba -sdl -snappy -sndio -speex -srt -ssh -static-libs -svg -test -truetype -twolame -v4l -vdpau -vidstab -vorbis -vulkan -webp -zeromq -zimg -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" VIDEO_CARDS="nvidia" 0 KiB
[ebuild   R    ] media-video/mplayer-1.4-r1::gentoo  USE="X alsa bs2b cdio cdparanoia cpudetection dga dvd dvdnav enca encode iconv ipv6 jack jpeg libass mp3 network opengl osdmenu rtc shm truetype unicode xscreensaver xv xvid yuv4mpeg -a52 -aalib (-altivec) (-aqua) -bidi -bl -bluray -cddb -debug -doc -dts -dv -dvb -faac -faad -fbcon -ftp -ggi -gsm -joystick -ladspa -libcaca -libmpeg2 -lirc -live -lzo -mad -md5sum -mng -nas -openal -oss -png -pnm -pulseaudio -pvr -radio -rar -rtmp -samba -sdl (-selinux) -speex -tga -theora -toolame -tremor -twolame -v4l -vcd -vdpau (-vidix) -vorbis -x264 -xinerama -zoran" CPU_FLAGS_X86="mmx mmxext sse sse2 ssse3 -3dnow -3dnowext" VIDEO_CARDS="-mga" 0 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB
Moreover the build of ffmpeg mplayer succeeds, and subsequently

Code: Select all

$ mplayer foo.unknown_video 
MPlayer 1.4-9.3.0 (C) 2000-2019 MPlayer Team

Playing foo.unknown_video.
libavformat version 58.76.100 (external)
libavformat file format detected.
[lavf] stream 0: subtitle (text), -sid 0
LAVF: no audio or video headers found - broken file?
No stream found.


Exiting... (End of file)
Opening foo.unknown_video in an editor (emacs) reveals it to be meta data for a video (including a url) of the type
https:\/\/site\/videos\/directory_1\/directory_2\/directory_3\/video.mp4?validfrom=1644595194&validto=1645602394&rate=50000k&burst=50000k&hash=L3%2BBwTLIFA3UfTEYs2uqZ9LgkBw%3D
Attempting to get the indicated video with wget results in "Connection refused".

I conjecture that the "validfrom" and "validto" are timestamps and that "hash" is a hash of part of what follows "?" in the url. Any ideas concerning how to modify the url (perhaps timestamps and hash) so as to enable wget to succeed?
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Fri Feb 11, 2022 5:29 pm

It works fine on me
Plz try

Code: Select all

youtube-dl https://www.youtube.com/watch?v=EngW7tLk6R8
What is output?
You will need to enable "opus" in both ffmpeg and mplayer in adittion to any needed formats and codecs.
:)
Top
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

  • Quote

Post by dpaddy » Fri Feb 11, 2022 6:53 pm

I've recompiled enabling "opus" in both ffmpeg and mplayer .

Sure, youtube-dl works on your url (namely https://www.youtube.com/watch?v=EngW7tLk6R8), but with my_url the behavior is as I've described. More precisely, executing youtube-dl with my_url first prints (to the xterminal)
[1] 24084
[2] 24085
and then immediately displays a command prompt ($) followed by four lines, namely
$ [website] 38971641: Downloading webpage
[website] 38971641: Downloading m3u8 information
[download] Destination: foo.unknown_video
[download] 100% of 892.00B in 00:00
whereupon I get no new command prompt - as I suppose it ($) was already printed before the four lines following it were output. By the way, "website" and "my_url" are place holders for the actual website and url.

Curiously enough, executing
youtube-dl my_url ; ls
results in the output of "ls" being sent to the xterminal before the four lines mentioned above. I suppose youtube-dl creates and puts two jobs in the background, evidenced by the output
[1] 24084
[2] 24085
and those jobs are responsible for the four lines of output mentioned above (which took place after "ls" had finished).

Anyhow, any ideas concerning how to modify the url (perhaps timestamps and hash) so as to enable wget to succeed?
Top
grknight
Retired Dev
Retired Dev
Posts: 2565
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Fri Feb 11, 2022 6:56 pm

I suggest quoting the URL on the command-line so the shell does not interpret any characters, e.g.

Code: Select all

youtube-dl 'https://foo.example/play?vid=abc123' ; ls
Top
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

  • Quote

Post by dpaddy » Fri Feb 11, 2022 6:59 pm

Quoting the URL on the command-line does make a difference, thanks for that. However, the resulting file contains (admittedly different) meta data, mplayer behaves as described above, and wget of the url in the metadata fails.
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Fri Feb 11, 2022 7:23 pm

but with my_url the behavior is as I've described
do you mind sharing your url?
:)
Top
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

  • Quote

Post by dpaddy » Fri Feb 11, 2022 7:45 pm

I would rather not.

Anyhow, I conjecture that the time stamps are the problem so if I could make a bash script that executes wget soon enough then I might succeed.

Unfortunately experience has shown that I cannot write working bash scripts (except for trivial ones) to save my life :oops: I will later open a question about bash scripting in an attempt to get beyond my deep and profound confusion concerning scripting.

Thanks all!
Top
figueroa
Advocate
Advocate
User avatar
Posts: 3032
Joined: Sun Aug 14, 2005 8:15 pm
Location: Edge of marsh USA
Contact:
Contact figueroa
Website

  • Quote

Post by figueroa » Sat Feb 12, 2022 5:32 am

Add --restrict-filenames option, example:

Code: Select all

youtube-dl --restrict-filenames 'https://www.youtube.com/watch?v=i-x5SQmajnM'
The example is a "small" mp4 file. It should just work. Always quote the URL.
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi -wayland
Top
Chiitoo
Ninja Apprentice
Ninja Apprentice
User avatar
Posts: 3079
Joined: Sun Feb 28, 2010 5:36 pm
Location: Sore wa sore, kore wa kore... nanoda.

><)))°€

  • Quote

Post by Chiitoo » Sat Feb 12, 2022 11:22 am

dpaddy wrote:

Code: Select all

# emerge -pv ffmpeg mplayer 
 * Last emerge --sync was 160d 1h 3m 9s ago.
Is 'youtube-dl' more than 160 days old now as well? :]

While it does seem like 'youtube-dl' has picked up a lot more contributions as of late, a lot of places switched to the more active (at the time anyblue) 'yt-dlp', and I'd suggest giving that a go as well.

That, and I can find some '.unknown_video' issues on the youtube-dl issue tracker, so looking into those might be worthwhile as well (some of the replies from the developer at the time were simply along the lines of "unsupported source" or so).
Kindest of regardses.
Top
dpaddy
Apprentice
Apprentice
Posts: 176
Joined: Wed Jun 25, 2008 8:43 pm

  • Quote

Post by dpaddy » Sun Feb 13, 2022 3:15 pm

Through trial and error I managed to get a bash script (with checking throughout to ensure against injection attacks) to fetch the metadata (via youtube-dl) and immediately execute wget on the file pointed to within the metadata (it pulled down a mp4 which mplayer played with no problem). Worked like a charm! :)

I would imagine that different sites may return different metadata, but perhaps this thread could nevertheless be of some use to others.

I appreciate all comments contributed. Thanks!
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Feb 13, 2022 5:29 pm

dpaddy wrote:

Code: Select all

# emerge -pv ffmpeg mplayer 
 * Last emerge --sync was 160d 1h 3m 9s ago.
As hinted at elsewhere, you should sync your tree and apply pending updates.
dpaddy wrote:Opening foo.unknown_video in an editor (emacs)
Check whether emacs has a mode for playing video? ;)
dpaddy wrote:reveals it to be meta data for a video (including a url) of the type
https:\/\/site\/videos\/directory_1\/directory_2\/directory_3\/video.mp4?validfrom=1644595194&validto=1645602394&rate=50000k&burst=50000k&hash=L3%2BBwTLIFA3UfTEYs2uqZ9LgkBw%3D
Attempting to get the indicated video with wget results in "Connection refused".
That is weird. Even if the URL were to a path which the server refused to return, Connection refused should not happen. That should be reserved for "The server process is not running, so the peer kernel refused to accept the TCP connection."
dpaddy wrote:I conjecture that the "validfrom" and "validto" are timestamps
You don't recognize the current time when printed as a Unix epoch? ;) In this case:

Code: Select all

$ date -u -d @1644595194
Fri Feb 11 15:59:54 UTC 2022
$ date -u -d @1645602394
Wed Feb 23 07:46:34 UTC 2022
dpaddy wrote:Any ideas concerning how to modify the url (perhaps timestamps and hash) so as to enable wget to succeed?
Assuming you recounted the wget error correctly, you need to point wget to a server that is actually listening. The path is irrelevant if the server will not listen to you. The full output of wget would be helpful here. Anonymize the URL and hostname if you must, but show all the other status data.
dpaddy wrote:Quoting the URL on the command-line does make a difference, thanks for that.
Your shown URL, even anonymized, has significant shell metacharacters. Specifically, &, which was backgrounding the command. You ran the equivalent of:

Code: Select all

youtube-dl https:\/\/site\/videos\/directory_1\/directory_2\/directory_3\/video.mp4?validfrom=1644595194 &		# Placed into background.  Note the badly truncated URL.
validto=1645602394 &	# Backgrounded assignment.  This is useless, but probably harmless.
rate=50000k &	# Same.
burst=50000k &	# Same.
hash=L3%2BBwTLIFA3UfTEYs2uqZ9LgkBw%3D	# Foreground assignment.  Useless, but probably harmless.
dpaddy wrote:I would rather not.
As you wish. However, it would be much easier for us to help you if we had a working example. It need not be the specific video you are trying to fetch, but having it come from the same server software would help.
dpaddy wrote:Anyhow, I conjecture that the time stamps are the problem so if I could make a bash script that executes wget soon enough then I might succeed.
Maybe, but based on how I decode them, they appear to be valid for days at a time, so even at human reaction speeds, you should have gotten correct results when doing this by hand.
dpaddy wrote:Through trial and error I managed to get a bash script
If you post the script, we could review it for you.
dpaddy wrote:I would imagine that different sites may return different metadata, but perhaps this thread could nevertheless be of some use to others.
The thread would be of more use if you share the script, so that the next person does not need to reimplement it. ;)
Top
Post Reply

14 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic