Welcome!

Please read this important information about Spectre and Meltdown vulnerabilities.
Please read this important information about MX sources lists.
News
  • MX Linux on social media: here
  • Mepis support still here
Current releases
  • MX-17 Final release info here
  • MX-16.1 release info here
  • antiX-17 release info here
    New users
    • Please read this first, and don't forget to add system and hardware information to posts!
    • Read Forum Rules

Question Concerning Copying vs Transcoding

Message
Author
User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Question Concerning Copying vs Transcoding

#1 Postby joany » Mon Sep 08, 2014 10:47 am

The following simple code can convert .flv video files into .mp4 format:

Code: Select all

ffmpeg -i infile.flv -codec copy outfile.mp4


The above conversion process is very fast. It's just as fast as copying it and uses very few resources -- when it works. But occasionally there are .flv files that cannot be converted with this technique, which throws up errors about the -codec parameter:

Code: Select all

[mp4 @ 0x9e11fa0] Could not find tag for codec flv1 in stream #0, codec not currently supported in container
Output #0, mp4, to 'shelly.mp4':

Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument


When such .flv files are encountered, they can be transcoded with HandBrake or a modified ffpeg command. Unfortunately transcoding takes a long time and uses a lot of resources.

1. Can someone explain why the simple copying technique works for some .flv files and not others?
2. Can someone offer an improved copying command that works for all .flv files?
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 7571
Joined: Sun Dec 16, 2007 1:17 pm

Re: Question Concerning Copying vs Transcoding

#2 Postby dolphin_oracle » Mon Sep 08, 2014 2:29 pm

I think that the -codec copy command is only demuxing, not transcoding, so you are in effect just copying the movie stream from one container to another. I suspect that the times when this fails, the stream contained in the flv file is not able to be demuxed to to mpg4 directly. that's when you have to transcode, which as you noted takes forever.
http://www.youtube.com/runwiththedolphin
eeepc 904ha antix 15 32 bit (streaming media player)
acer c720p chromebook - chromeos / MX15-64 (custom snapshot) live USB.
lenovo s21e - antiX-16 MX16(live-usb)

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Re: Question Concerning Copying vs Transcoding

#3 Postby joany » Mon Sep 08, 2014 3:15 pm

dolphin_oracle wrote:I think that the -codec copy command is only demuxing, not transcoding, so you are in effect just copying the movie stream from one container to another. I suspect that the times when this fails, the stream contained in the flv file is not able to be demuxed to to mpg4 directly. that's when you have to transcode, which as you noted takes forever.

Thanks. I figured it has something to do with how the .flv file is authored, but I didn't know exactly what the reason was. In order to view videos on my Kindle or through my BluRay player, they need to be in .mp4 format. It would be nice if everyone could settle on one video codec standard instead of half a dozen different ones ... sigh.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 7571
Joined: Sun Dec 16, 2007 1:17 pm

Re: Question Concerning Copying vs Transcoding

#4 Postby dolphin_oracle » Mon Sep 08, 2014 4:30 pm

look for more confusion on web formats as HTML5 takes over. webm and vorbis formats are built in to the HTML5 spec. in fact, youtube seems to like my videos better when encoded in webm rather than mp4.
http://www.youtube.com/runwiththedolphin
eeepc 904ha antix 15 32 bit (streaming media player)
acer c720p chromebook - chromeos / MX15-64 (custom snapshot) live USB.
lenovo s21e - antiX-16 MX16(live-usb)

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 14420
Age: 59
Joined: Fri Dec 15, 2006 8:07 pm

Re: Question Concerning Copying vs Transcoding

#5 Postby Stevo » Mon Sep 08, 2014 5:42 pm

.flv files can contain video in several different codec formats. Though almost all now are encoded in h.264, which mp4 does support, originally Flash did not have support for that codec, and they used several different proprietary codecs, such as h.263. The message you are getting means that the .mp4 container doesn't support that older flv1 codec, so it needs to be transcoded to something that it does support.

According to Wikipedia, full h.264 support was added to Flash 10 in 2008.


Return to “Software / Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest