[GH-ISSUE #19] Add info video codec and transcoding FFMPEG #16

Open
opened 2026-02-25 20:32:11 +03:00 by kerem · 14 comments
Owner

Originally created by @diaskooo on GitHub (Jan 21, 2015).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/19

Hello.
Not all files are shown on TV because of codecs especially MKV files if the codec is not MP4
Perhaps add transcoding on the fly using FFMPEG?
And to add to informtsiyu video file codecs video and audio, resolution, etc. in response json

Originally created by @diaskooo on GitHub (Jan 21, 2015). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/19 Hello. Not all files are shown on TV because of codecs especially MKV files if the codec is not MP4 Perhaps add transcoding on the fly using FFMPEG? And to add to informtsiyu video file codecs video and audio, resolution, etc. in response json
Author
Owner

@asapach commented on GitHub (Jan 21, 2015):

I need to think about it. I'm not sure if ffmpeg will support proper streaming over torrent-stream. I'll take a look at https://github.com/fluent-ffmpeg/node-fluent-ffmpeg

<!-- gh-comment-id:70921720 --> @asapach commented on GitHub (Jan 21, 2015): I need to think about it. I'm not sure if ffmpeg will support proper streaming over torrent-stream. I'll take a look at https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
Author
Owner

@diaskooo commented on GitHub (Jan 22, 2015):

Напишу на русском, так проще будет объяснить.

Можно глянуть еще вот это вариант https://github.com/trenskow/stream-transcoder.js

Было бы идеально если были такие варианты:

  1. Ссылка на оригинальное видео
  2. Transcoding c оригинальным качеством только кодеки менять видео и аудио
  3. Transcoding с выбором качества видео (1080, 720, 480) и выбором доп настройками
<!-- gh-comment-id:70975837 --> @diaskooo commented on GitHub (Jan 22, 2015): Напишу на русском, так проще будет объяснить. Можно глянуть еще вот это вариант https://github.com/trenskow/stream-transcoder.js Было бы идеально если были такие варианты: 1) Ссылка на оригинальное видео 2) Transcoding c оригинальным качеством только кодеки менять видео и аудио 3) Transcoding с выбором качества видео (1080, 720, 480) и выбором доп настройками
Author
Owner

@asapach commented on GitHub (Jan 24, 2015):

See #20.
If you append ?ffmpeg=probe to the end of the video URL it will return the metadata in JSON format.
?ffmpeg=remux will remux the file, e.g. will convert from MKV to MP4 without loss of video quality.
If remuxing proves to be viable, I could also add transcoding.

<!-- gh-comment-id:71337152 --> @asapach commented on GitHub (Jan 24, 2015): See #20. If you append `?ffmpeg=probe` to the end of the video URL it will return the metadata in JSON format. `?ffmpeg=remux` will remux the file, e.g. will convert from MKV to MP4 without loss of video quality. If remuxing proves to be viable, I could also add transcoding.
Author
Owner

@asapach commented on GitHub (Apr 21, 2015):

It turns out that WEBM is a much more suitable alternative for streaming video (e.g. youtube uses it) and it has better browser support now. I've replaced remuxing with transcoding into webm: vp8 for video and vorbis for audio.

<!-- gh-comment-id:94751746 --> @asapach commented on GitHub (Apr 21, 2015): It turns out that [WEBM](http://www.webmproject.org/) is a much more suitable alternative for streaming video (e.g. youtube uses it) and it has better browser support now. I've replaced remuxing with transcoding into webm: vp8 for video and vorbis for audio.
Author
Owner

@AMerkuri commented on GitHub (Apr 28, 2015):

How about instead of transcoding video into another format but adding support to open .mkv files right in VLC?

<!-- gh-comment-id:97126386 --> @AMerkuri commented on GitHub (Apr 28, 2015): How about instead of transcoding video into another format but adding support to open .mkv files right in VLC?
Author
Owner

@asapach commented on GitHub (Apr 28, 2015):

You can install the VLC browser plugin and it will handle .mkv files. You can also open the video in VLC manually by copying the link, opening VLC, then Media / Open Network Stream... (or Ctrl+N) and pasting the link there.
No way to automate this from the browser, though.
It might be possible to start VLC on the server machine, but you are better of using peerflix for that.

<!-- gh-comment-id:97127825 --> @asapach commented on GitHub (Apr 28, 2015): You can install the VLC browser plugin and it will handle .mkv files. You can also open the video in VLC manually by copying the link, opening VLC, then `Media / Open Network Stream...` (or `Ctrl+N`) and pasting the link there. No way to automate this from the browser, though. It might be possible to start VLC on the server machine, but you are better of using `peerflix` for that.
Author
Owner

@AMerkuri commented on GitHub (Apr 28, 2015):

I tried copying download link to VLC Media / Open Network Stream...
it gives me output: Your input can't be opened: VLC is unable to open the MRL Check the log for details.
And the log output. http://hastebin.com/zisojacexa.tex

I can download and play mkv just fine but I can't stream it to VLC?

<!-- gh-comment-id:97135064 --> @AMerkuri commented on GitHub (Apr 28, 2015): I tried copying download link to VLC `Media / Open Network Stream...` it gives me output: `Your input can't be opened: VLC is unable to open the MRL Check the log for details.` And the log output. http://hastebin.com/zisojacexa.tex I can download and play mkv just fine but I can't stream it to VLC?
Author
Owner

@asapach commented on GitHub (Apr 28, 2015):

Works for me: http://hastebin.com/eriwikilis.1c

<!-- gh-comment-id:97148190 --> @asapach commented on GitHub (Apr 28, 2015): Works for me: http://hastebin.com/eriwikilis.1c
Author
Owner

@AMerkuri commented on GitHub (Apr 28, 2015):

Strange.. It started to work for me now.. Many thanks for quick response(s)! 👍

<!-- gh-comment-id:97152842 --> @AMerkuri commented on GitHub (Apr 28, 2015): Strange.. It started to work for me now.. Many thanks for quick response(s)! :+1:
Author
Owner

@asapach commented on GitHub (May 16, 2015):

Another alternative to plain remuxing/transcoding could be HLS, an Apple proprietary protocol that is supported by iOS and Android, and some players including VLC (though might be problematic in the browser). The idea is that video is broken into 10-second segments and an index file is created that lists all the segments and their time codes. It should be relatively easy to transcode each individual segment on demand and the index file should allow seeking (with 10-second precision, but that's better than nothing).

Another option could be DASH, but it's much more complicated and not as widely supported.

<!-- gh-comment-id:102701649 --> @asapach commented on GitHub (May 16, 2015): Another alternative to plain remuxing/transcoding could be [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming), an Apple proprietary protocol that is supported by iOS and Android, and some players including VLC (though might be problematic in the browser). The idea is that video is broken into 10-second segments and an index file is created that lists all the segments and their time codes. It should be relatively easy to transcode each individual segment on demand and the index file should allow seeking (with 10-second precision, but that's better than nothing). Another option could be [DASH](https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP), but it's much more complicated and not as widely supported.
Author
Owner

@Porco-Rosso commented on GitHub (Oct 3, 2015):

Any progress on this front?

also, is ?ffmpeg=remux working in the latest master? I seem to just get a 502 error, and am not sure if it is because of my nginx reverse proxy.

<!-- gh-comment-id:145243713 --> @Porco-Rosso commented on GitHub (Oct 3, 2015): Any progress on this front? also, is `?ffmpeg=remux` working in the latest master? I seem to just get a 502 error, and am not sure if it is because of my nginx reverse proxy.
Author
Owner

@asapach commented on GitHub (Oct 3, 2015):

Yes, remuxing to WebM should be working. Please make sure that you have ffmpeg in your path: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg#ffmpeg-and-ffprobe and check the console/logs for error messages.

<!-- gh-comment-id:145254011 --> @asapach commented on GitHub (Oct 3, 2015): Yes, remuxing to WebM should be working. Please make sure that you have ffmpeg in your path: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg#ffmpeg-and-ffprobe and check the console/logs for error messages.
Author
Owner

@Porco-Rosso commented on GitHub (Oct 4, 2015):

thanks, for future people who might read this, on Debian 8 I had to run:

echo deb deb http://www.deb-multimedia.org jessie main non-free \
                  >>/etc/apt/sources.list

Followed by

sudo apt-get update
sudo apt-get install deb-multimedia-keyring
sudo apt-get update
sudo apt-get install ffmpeg
<!-- gh-comment-id:145366099 --> @Porco-Rosso commented on GitHub (Oct 4, 2015): thanks, for future people who might read this, on Debian 8 I had to run: ``` echo deb deb http://www.deb-multimedia.org jessie main non-free \ >>/etc/apt/sources.list ``` Followed by ``` sudo apt-get update sudo apt-get install deb-multimedia-keyring sudo apt-get update sudo apt-get install ffmpeg ```
Author
Owner

@stfl commented on GitHub (Jan 4, 2018):

I usually play it with mpv from the command line which uses ffmpeg like:

mpv "http://localhost..." --sub-file "http://localhost..."

works far better than "server-side" decoding or in-browser playing..

<!-- gh-comment-id:355367602 --> @stfl commented on GitHub (Jan 4, 2018): I usually play it with mpv from the command line which uses ffmpeg like: mpv "http://localhost..." --sub-file "http://localhost..." works far better than "server-side" decoding or in-browser playing..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#16
No description provided.