Transcoding not completely ended not closed breaks batch

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Trebly
Blank Cone
Blank Cone
Posts: 22
Joined: 20 May 2009 00:52

Transcoding not completely ended not closed breaks batch

Postby Trebly » 24 Dec 2011 02:04

Hi,
First of all, if I post here it is because :
  • the problem encountered seems not localized as depending of the system used but on treatment of video files (all coming from same source)
  • After seeking to most of post (keywords : < batch, transcoding, file >) I don't found any answer
Phenomenon :
A batch (windows) contains the commands :
  • Repeat for all occurrences of files names in file temp.dir the Sub-conv-exe-test_05.cmd :

    Code: Select all

    for /F "usebackq" %%f in (temp.dir) do (call E:\cmdfiles\Sub-conv-exe-test_05.cmd "%%f" "%var1%\%%~nf%fext1%.mp4" "%logf1%")
  • Files input are AVI file coming from a Samsung S28
    The sub contains the vlc command

    Code: Select all

    C:\Progra~2\VideoLAN\VLC\vlc.exe -I dummy -vvv %1 --sout "#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:file{dst=%~2} VLC://quit " >> %3
The transcoding stop at the end of the file, saying "nothing to display, as if was waiting a command to play something while the parameters seems to say "output to file" then close and quit VLC.
May I have not seen additional parameters to say "close the file, and don't play anything", job is ended; but I have not found examples with such commands.

The trace display into the text window "-I dummy", the trace reported in note.

The produced file is quite good duration note 2second less (1mn26s for 1mn28s for original file. orig AVI size : 135Mo result file mp4 size : 30.5 Mo)
the errors occurs all during the treatment. The files generated repeating the treatment have not exactly the same size.

At the end the VLC window (txt display of trace) doesn't close (cursor locked into the window on last line, no action possible).
To stop the window must be closed manually.
This generates on the main batch window the request "continue or cancel Y/N "
The produced file is played well by VLC or WMP but a stream called from an Upnp (Free Media player, FreeBox HD) managed by WMP network (the system with Win7 x64 system is not yet designed for VLC streaming) doesn't close and shows the message "invalid file format", on the display system this situation leads to close manually and the process doesn't return to the next batch sequence (file to treat).

Then, after this job, there are several questions about anomaly but too some ideas and suggestions about VLC control :
  • The treatment anomaly which stops the job (or batch command error ?, which one it seems for me OK, but I am partially newbie...)
  • For each run, for the same input file obviously, the size of the generated files is lightly different, why ? Even with error the exact size could be the same...
  • The treatment with GUI display (don't recommended but possible : see note 1) doesn't show any error (seems able to be used for other operation on files, but GUI config functions - reduced). Could be used to display progress bar and time and may be any error on file treatment. But this could be recommanded only if files functions could be disabled completely, how, may be a solution ? It seems possible to operate on playlist but it is not operational, even the file name is there run play doesn't show the file, seems to run again at treatment rhythm (quicker for my computer) not at display rythm.
    Note : As "uncommon" use : if the batch has not the quit command (which is not operated because of the error) normally the GUI should not be "quit" then the operator could manipulate, particularly look at the file which has been just generated. Then we get so a batch with operator control.
  • It is a way I would look at : As it is possible to have a group of transcode streams of files or others in input the batch can send files by groups or made several treatments on same file(s).
    How or not, can be processed by batch the following : send to a VLC TUI (as a shell opened in command line) after a first launch only the streams to run and to avoid scripting, in fact a "VLCX ?" which pipes the streams to execute to the input waiting list of a resident VLC (an instance of, because several can be launched). If it exist it can be submitted by others ways.
    May be I have not sufficiently red about VLC (no time till now to read about VLM and pluggins) to find how to do this... I would know where I can find answers to target this subject... VLC is so large...
    It is sure that seeing that : batch and VLC waiting (in fact not closed as it should) the idea was not far to imagine to send command to VLC from a batch rather than launching it and quitting for each treatment.
Waiting for help (because) the files that I have generated can't be used in some streams even they can be displayed individually.

Best regards

Trebly

*-----------------------------------------------------------------------------------------

Note 1 :
If the following command is used (omitting "-I dummy" and option "-vvv":

Code: Select all

C:\Progra~2\VideoLAN\VLC\vlc.exe %1 --sout "#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:file{dst=%~2} VLC://quit " >> %3
the main interface is opened and shows the operation as a play the file name appears in the playlist.
But the transcoding don't "quit"
If the operator then uses "exit" of the VLC GUI menu the batch job goes on (it is VLC which closes not the system), but the files generated are the same and produce the same error in streaming.


Note 2 : Trace of execution sample

Code: Select all

* ---------------------- Execution trace ----------------------------------------------- [0263c344] avi demux warning: cannot get packet header, track disabled [02113594] main input debug: EOF reached [02113594] main input debug: waiting decoder fifos to empty [026669dc] main playlist debug: finished input [0267c464] main decoder debug: thread times: real 0m32.368851s, kernel 0m0.76440 4s, user 0m17.752913s [0267c464] main decoder debug: removing module "packetizer_copy" [0267c464] main decoder debug: killing decoder fourcc `MJPG', 0 PES in FIFO [0263c404] main stream output debug: removing a sout input (sout_input:02691110) [042e4024] main encoder debug: TIMER encoding video frame : 0.000 ms - Total 963 0.000 ms / 2661 intvls (Avg 3.619 ms) [042e3ccc] avcodec generic debug: ffmpeg codec (Motion JPEG Video) stopped [042e3ccc] main generic debug: removing module "avcodec" [042e4024] x264 encoder debug: framecount still in libx264 buffer: 55 x264 [info]: frame I:11 Avg QP:23.62 size: 43923 x264 [info]: frame P:1312 Avg QP:26.63 size: 19461 x264 [info]: frame B:1283 Avg QP:30.96 size: 3540 x264 [info]: consecutive B-frames: 1.8% 97.2% 0.9% 0.0% x264 [info]: mb I I16..4: 6.2% 89.7% 4.2% x264 [info]: mb P I16..4: 2.3% 8.0% 0.5% P16..4: 33.7% 25.6% 21.1% 0.0% 0 .0% skip: 8.8% x264 [info]: mb B I16..4: 0.3% 0.7% 0.0% B16..8: 46.7% 0.0% 0.0% direct: 3.9% skip:48.2% L0:28.9% L1:24.9% BI:46.2% x264 [info]: 8x8 transform intra:74.9% inter:73.7% x264 [info]: coded y,uvDC,uvAC intra: 61.1% 55.6% 20.4% inter: 36.4% 25.7% 4.1% x264 [info]: i16 v,h,dc,p: 58% 24% 12% 6% x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 15% 43% 3% 3% 3% 3% 5% 5% x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 17% 20% 5% 6% 7% 6% 7% 5% x264 [info]: i8c dc,h,v,p: 64% 15% 19% 2% x264 [info]: Weighted P-Frames: Y:31.6% UV:7.0% x264 [info]: ref P L0: 57.3% 17.4% 15.8% 8.4% 1.1% x264 [info]: ref B L0: 83.5% 16.5% 0.0% x264 [info]: ref B L1: 99.9% 0.1% x264 [info]: kb/s:2814.15 [042e4024] main encoder debug: removing module "x264" [026be64c] main stream out debug: Filter 0466080c removed from chain [0466080c] main filter debug: removing module "swscale" [026a294c] mux_mp4 mux debug: removing input [0267d7bc] main decoder debug: thread times: real 0m32.400853s, kernel 0m0.03120 0s, user 0m3.510022s [0267d7bc] main decoder debug: removing module "packetizer_copy" [0267d7bc] main decoder debug: killing decoder fourcc `s16l', 0 PES in FIFO [0263c404] main stream output debug: removing a sout input (sout_input:026911e8) [026725d4] main encoder debug: TIMER encoding audio frame : 0.000 ms - Total 262 0.000 ms / 6209 intvls (Avg 0.422 ms) [02686b44] main generic debug: removing module "araw" [026725d4] main encoder debug: removing module "avcodec" [026be64c] main stream out debug: Filter 02692134 removed from chain [02692134] main filter debug: removing module "audio_format" [026be64c] main stream out debug: Filter 02709a3c removed from chain [02709a3c] main filter debug: removing module "bandlimited_resampler" [026be64c] main stream out debug: Filter 042b2d9c removed from chain [042b2d9c] main filter debug: removing module "audio_format" [026a294c] mux_mp4 mux debug: removing input [026a294c] main mux warning: no more input streams for this mux [0263c344] main demux debug: removing module "avi" [026be7bc] main stream debug: removing module "stream_filter_record" [026aa354] main access debug: removing module "filesystem" [02113594] main input debug: Program doesn't contain anymore ES [02113594] main input debug: thread ended [026669dc] main playlist debug: dead input [0263c404] main stream output debug: destroying useless sout [026be64c] main stream out debug: destroying chain... (name=transcode) [026be64c] main stream out debug: removing module "stream_out_transcode" [026be64c] main stream out debug: destroying chain done [026be594] main stream out debug: destroying chain... (name=file) [026a294c] mux_mp4 mux debug: Close [026a294c] mux_mp4 mux debug: movie duration 86s [026a294c] mux_mp4 mux debug: created 2602 chunks (stco) [026a294c] mux_mp4 mux debug: created 2603 chunks (stco) [026a294c] main mux debug: removing module "mux_mp4" [02143b2c] access_output_file access out debug: file access output closed [02143b2c] main access out debug: removing module "access_output_file" [026be594] main stream out debug: removing module "stream_out_standard" [026be594] main stream out debug: destroying chain done [02113594] main input debug: thread times: real 0m32.496858s, kernel 0m0.187201s , user 0m0.156001s [02113594] main input debug: TIMER input launching for 'B10717/SAM_0173.AVI' : 1 00.000 ms - Total 100.000 ms / 1 intvls (Avg 100.000 ms) [026669dc] main playlist debug: changing item without a request (current 0/1) [026669dc] main playlist debug: nothing to play <window remains open here and stopped : job is canceled by closing the output txt window, the file is then closed by system>
*-----------------------------------------------------------------------------------------------------------------

Note 3 : Environment of work : Win7 x64, on AsusG73S (2630Qn) and 12Go memory

Trebly
Blank Cone
Blank Cone
Posts: 22
Joined: 20 May 2009 00:52

Re: Transcoding not completely ended not closed breaks batch

Postby Trebly » 03 Jan 2012 04:57

Hi,
The first part of my questions found his solution into the syntax.


Sorry ERRATA before 02/06/2012 15h Paris


With windows Batch, if output file contains blanck chars (it can and the batch parameters sets out the "..." before treating the parameters.
Generally you could find a sequence like dst=".. file name ...". It is not the right way.

If the -sout command syntax used is WRONG CODE

Code: Select all

VLC %1 -I dummy --sout #transcode{......................................... dst=" <filename>"} VLC://quit
the transcode is parsed by Dos between the {...} which are not DOS batch command separators and fails (not transmitted as a one parameter block to VLC

The right code is : RIGHT CODE

Code: Select all

VLC %1 -I dummy --sout"#transcode{......................................... dst=<filename>}" VLC://quit
contains four parameters. file input, output, one --sout transcode and then VLC quit.

For details about how to chain treatments and the tricks see the #96837 is then solved viewtopic.php?f=2&t=96837

This thread : #96587 is partially solved (an answer as been redacted). It remains abnormalities of file treatment with lost images and and seems generate not well closed files (the end of file lost for some frames ? size for multiple treatments of same file not of the same size), may be then streaming the mp4 file with WMP network end with a "bad format, not supported" message (this while both the GUI play well the files).

Best regards

Trebly


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 61 guests